home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / NGL2.0.1J(ppc).sit / NGL2.0.1J(ppc) / Pict Effect Sample / Pict Effect Sample2(ppc).c < prev    next >
C/C++ Source or Header  |  1996-09-17  |  5KB  |  204 lines

  1. /*============================================================
  2.  
  3.                     N_PICT サンプルプログラム(マルチウィンドウ)
  4.                     
  5. ============================================================*/
  6. #include        "N_Library.h"
  7.  
  8. void            Bt_Check(void);
  9. short        Data_Rsrc = 0;
  10. long            wait;
  11.  
  12. void main(void)
  13. {
  14.     short        i;
  15.     WindowPtr    window;
  16.  
  17.     ToolboxInit();
  18.     ColorCheck();
  19.     HideCursor();
  20.     window = GetNewWindow (129,nil,(WindowPtr)-1L );
  21.     ShowWindow(window);
  22.     SetWTitle(window,"¥pWindow1");
  23.     N_Window_Set_Multi(1,window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);
  24.     window = GetNewWindow (129,nil,(WindowPtr)-1L );
  25.     MoveWindow(window,-(window->portBits.bounds.left)+50,-(window->portBits.bounds.top)+50,false);
  26.     SetWTitle(window,"¥pWindow2");
  27.     ShowWindow(window);
  28.     N_Window_Set_Multi(2,window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);
  29.     window = GetNewWindow (129,nil,(WindowPtr)-1L );
  30.     MoveWindow(window,-(window->portBits.bounds.left)+100,-(window->portBits.bounds.top)+100,false);
  31.     SetWTitle(window,"¥pWindow3");
  32.     ShowWindow(window);
  33.     N_Window_Set_Multi(0,window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);
  34.  
  35.     Open_Resource_File(128,1,&Data_Rsrc);
  36.     N_Pict_Draw(129,0,0,0,false);                            //画像をバッファに読み込む(非表示)
  37.     N_Pict_Draw(130,0,0,0,false);
  38.     Close_Resource_File(&Data_Rsrc);
  39.  
  40.     for (i=0;i!=60;i++)                                        //瞬時切り替え
  41.     {
  42.         N_Current_Window_Set(0);
  43.         N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);        //バッファに一度読んだ画像は瞬時に表示できる
  44.         N_Current_Window_Set(1);
  45.         N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);
  46.         N_Current_Window_Set(2);
  47.         N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
  48.         N_Current_Window_Set(0);
  49.         N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
  50.         N_Current_Window_Set(1);
  51.         N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
  52.         N_Current_Window_Set(2);
  53.         N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);
  54.         Bt_Check();
  55.     }
  56.     Delay(10,&wait);
  57.  
  58.     do
  59.     {
  60.         for (i=1;i!=17;i++)                                    //モザイクを大きくしていく(Ef0)
  61.         {
  62.             N_Current_Window_Set(0);
  63.             N_Pict_Effect (129,0,0,0,i,0);
  64.             N_Current_Window_Set(1);
  65.             N_Pict_Effect (129,0,0,0,i,0);
  66.             N_Current_Window_Set(2);
  67.             N_Pict_Effect (130,0,0,0,i,0);
  68.             Bt_Check();
  69.         }
  70.  
  71.         for (i=16;i!=0;i--)                                    //モザイクを小さくしていく(Ef0)
  72.         {
  73.             N_Current_Window_Set(0);
  74.             N_Pict_Effect (130,0,0,0,i,0);
  75.             N_Current_Window_Set(1);
  76.             N_Pict_Effect (130,0,0,0,i,0);
  77.             N_Current_Window_Set(2);
  78.             N_Pict_Effect (129,0,0,0,i,0);
  79.             Bt_Check();
  80.         }
  81.         Delay(30,&wait);
  82.  
  83.         for (i=1;i!=16;i++)                                    //(Ef1)                        
  84.         {
  85.             N_Current_Window_Set(0);
  86.             N_Pict_Effect (129,0,0,1,15,i);
  87.             N_Current_Window_Set(1);
  88.             N_Pict_Effect (129,0,0,1,15,i);
  89.             N_Current_Window_Set(2);
  90.             N_Pict_Effect (130,0,0,1,15,i);
  91.             Bt_Check();
  92.         }
  93.         Delay(30,&wait);
  94.  
  95.         for (i=1;i!=16;i++)                                    //(Ef2)        
  96.         {
  97.             N_Current_Window_Set(0);
  98.             N_Pict_Effect (130,0,0,2,15,i);
  99.             N_Current_Window_Set(1);
  100.             N_Pict_Effect (130,0,0,2,15,i);
  101.             N_Current_Window_Set(2);
  102.             N_Pict_Effect (129,0,0,2,15,i);
  103.             Bt_Check();
  104.         }
  105.         Delay(30,&wait);
  106.  
  107.         N_Current_Window_Set(0);
  108.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  109.         N_Current_Window_Set(1);
  110.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  111.         N_Current_Window_Set(2);
  112.         N_Pict_Effect (130,0,0,3,0,0);                        //(Ef3)        
  113.         for (i=0;i!=256;i++)
  114.         {
  115.             N_Current_Window_Set(0);
  116.             N_Pict_Effect (129,0,0,3,1,0);
  117.             N_Current_Window_Set(1);
  118.             N_Pict_Effect (129,0,0,3,1,0);
  119.             N_Current_Window_Set(2);
  120.             N_Pict_Effect (130,0,0,3,1,0);
  121.             Bt_Check();
  122.         }
  123.         Delay(30,&wait);
  124.  
  125.  
  126.         for (i=1;i!=17;i++)                                    //モザイクを大きくしていく(Ef0)
  127.         {
  128.             N_Current_Window_Set(0);
  129.             N_Pict_Effect (129,0,0,0,i,0);
  130.             N_Current_Window_Set(1);
  131.             N_Pict_Effect (129,0,0,0,i,0);
  132.             N_Current_Window_Set(2);
  133.             N_Pict_Effect (130,0,0,0,i,0);
  134.             Bt_Check();
  135.         }
  136.  
  137.         for (i=16;i!=0;i--)                                    //モザイクを小さくしていく(Ef0)
  138.         {
  139.             N_Current_Window_Set(0);
  140.             N_Pict_Effect (130,0,0,0,i,0);
  141.             N_Current_Window_Set(1);
  142.             N_Pict_Effect (130,0,0,0,i,0);
  143.             N_Current_Window_Set(2);
  144.             N_Pict_Effect (129,0,0,0,i,0);
  145.             Bt_Check();
  146.         }
  147.         Delay(30,&wait);
  148.  
  149.         for (i=1;i!=9;i++)                                    //(Ef2)        
  150.         {
  151.             N_Current_Window_Set(0);
  152.             N_Pict_Effect (129,0,0,2,8,i);
  153.             N_Current_Window_Set(1);
  154.             N_Pict_Effect (129,0,0,2,8,i);
  155.             N_Current_Window_Set(2);
  156.             N_Pict_Effect (130,0,0,2,8,i);
  157.             Bt_Check();
  158.         }
  159.         Delay(30,&wait);
  160.  
  161.         for (i=1;i!=9;i++)                                    //(Ef1)                        
  162.         {
  163.             N_Current_Window_Set(0);
  164.             N_Pict_Effect (130,0,0,1,8,i);
  165.             N_Current_Window_Set(1);
  166.             N_Pict_Effect (130,0,0,1,8,i);
  167.             N_Current_Window_Set(2);
  168.             N_Pict_Effect (129,0,0,1,8,i);
  169.             Bt_Check();
  170.         }
  171.         Delay(30,&wait);
  172.  
  173.         N_Current_Window_Set(0);
  174.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  175.         N_Current_Window_Set(1);
  176.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  177.         N_Current_Window_Set(2);
  178.         N_Pict_Effect (130,0,0,3,0,0);                        //(Ef3)        
  179.  
  180.         for (i=0;i!=256;i++)
  181.         {
  182.             N_Current_Window_Set(0);
  183.             N_Pict_Effect (129,0,0,3,1,0);
  184.             N_Current_Window_Set(1);
  185.             N_Pict_Effect (129,0,0,3,1,0);
  186.             N_Current_Window_Set(2);
  187.             N_Pict_Effect (130,0,0,3,1,0);
  188.             Bt_Check();
  189.         }
  190.         Delay(30,&wait);
  191.     }
  192.     while (true);
  193. }
  194.  
  195. void Bt_Check(void)
  196. {
  197.     if (Button()==true)
  198.     {
  199.         ColorRevert();
  200.         ShowCursor();
  201.         ExitToShell();
  202.     }
  203. }    
  204.